//
//  TJWithdrawalAlertView.m
//  Teleport
//
//  Created by hc-101 on 2020/6/19.
//  Copyright © 2020 xtjun. All rights reserved.
//

#import "TJWithdrawalAlertView.h"

@implementation TJWithdrawalAlertView


- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        
        UILabel *titleLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x111111) title:@"安全验证".localizedString textAlignment:NSTextAlignmentLeft];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(16);
            make.top.offset(0);
            make.height.offset(46);
        }];
        
        UILabel *cancelLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x111111) title:@"取消".localizedString textAlignment:NSTextAlignmentLeft];
        [cancelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.offset(-16);
            make.centerY.equalTo(titleLabel);
        }];
        
        
        UILabel *phoneLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x111111) title:[TJUserInfo.readInfo phone] textAlignment:NSTextAlignmentLeft];
        phoneLabel.text = [Tools hiddenPhoneMiddleWithString:phoneLabel.text];
        [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(16);
            make.top.equalTo(titleLabel.mas_bottom);
        }];
        
        UITextField *SMSTextField = [UITextField tj_addToView:self];
        SMSTextField.placeholder = @"请输入验证码".localizedString;
        SMSTextField.font = UIFont_Px(15);
        SMSTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
        SMSTextField.keyboardType = UIKeyboardTypeNumberPad;
        [SMSTextField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(titleLabel);
            make.top.equalTo(phoneLabel.mas_bottom).offset(12);
            make.height.offset(34);
            make.right.offset(-106);
        }];
        
        UIView *SMSLineView = [UIView tj_addToView:self];
        SMSLineView.backgroundColor = UIColor_Hex(0xE5E5E5);
        [SMSLineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(SMSTextField);
            make.right.equalTo(cancelLabel);
            make.height.offset(1);
            make.top.equalTo(SMSTextField.mas_bottom).offset(2);
        }];
        
        UILabel *resendLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x2C6CC7) title:@"发送".localizedString textAlignment:NSTextAlignmentLeft];
        [resendLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.offset(-16);
            make.centerY.equalTo(SMSTextField);
        }];
        
        
        UILabel *passwordLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x111111) title:@"资金密码".localizedString textAlignment:NSTextAlignmentLeft];
        [passwordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(16);
            make.top.equalTo(SMSLineView.mas_bottom).offset(16);
        }];
        
        UITextField *passwordTextField = [UITextField tj_addToView:self];
        passwordTextField.placeholder = @"请输入资金密码".localizedString;
        passwordTextField.secureTextEntry = YES;
        passwordTextField.font = UIFont_Px(15);
        passwordTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
        passwordTextField.keyboardType = UIKeyboardTypeNumberPad;
        [passwordTextField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(titleLabel);
            make.top.equalTo(passwordLabel.mas_bottom).offset(12);
            make.height.offset(34);
            make.right.offset(-16);
        }];
        
        
        UIView *lineView = [UIView tj_addToView:self];
        lineView.backgroundColor = UIColor.tj_separatorColor;
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(titleLabel);
            make.right.offset(-16);
            make.top.equalTo(passwordTextField.mas_bottom).offset(2);
            make.height.offset(1);
        }];
        
        UIButton *determineButton = [UIButton buttonWithSuperView:self font:UIFont_Px(18) color:UIColor.whiteColor title:@"确定".localizedString];
        determineButton.backgroundColor = UIColor_Hex(0x2C6CC7);
        [determineButton shearRoundedCornersWithRadiu:22];
        [determineButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.offset(-38);
            make.left.offset(38);
            make.height.offset(44);
            make.centerX.offset(0);
            make.top.equalTo(lineView.mas_bottom).offset(26);
        }];
        /**验证码输入框 */
        _SMSTextField = SMSTextField;
        /**发送 */
        _resendLabel = resendLabel;
        /**密码输入框 */
        _passwordTextField = passwordTextField;
        /**确定按钮 */
        _determineButton = determineButton;
        /**取消 */
        _cancelLabel = cancelLabel;
        
    }
    return self;
}



@end
